<template>
  <view class="component">
    <web-view :src="path"></web-view>
    <!--    <view class="btn">进入学习</view>-->
  </view>
</template>

<script>
import shareInfo from "@/utils/shareInfo"
import urlUtils from "@/utils/urlUtils"

export default {
  data() {
    return {
      path: "",
      btnText: "",
      jumpType: "",
      jumpPath: "",
      jumpAppid: "",
      shareTitle: "", //右上角分享标题
      shareImageSrc: "", //右上角分享图片路径
    }
  },
  onLoad(option) {
    this.path = decodeURIComponent(option.path)
    this.shareTitle = option.shareTitle
    this.shareImageSrc = decodeURIComponent(option.shareImageSrc)
    console.log(this.path, "this.path")
  },
  async onShareAppMessage() {
    return await shareInfo.getDefaultShareInfo({
      title: this.shareTitle ? this.shareTitle : null,
			imageUrl: this.shareImageSrc ? this.shareImageSrc : null,
			path: urlUtils.getCurrentPageUrl()
    })
  },
}
</script>

<style lang="scss" scoped>
.btn {
  position: fixed;
  z-index: 9999;
  bottom: 5vh;
  left: 50%;
  transform: translateX(-50%);
  padding: 10rpx 30rpx;
  background-color: var(--theme-color);
  color: var(--text-color-white);
  font-size: 34rpx;
}
</style>
